package com.ruanyun.modular.admin.mapper;

import com.ruanyun.modular.admin.entity.TBasicinfo;
import com.ruanyun.modular.admin.model.params.TBasicinfoParam;
import com.ruanyun.modular.admin.model.result.TBasicinfoResult;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 基本信息表 Mapper 接口
 * </p>
 *
 * @author zs
 * @since 2021-04-23
 */
@Repository
public interface TBasicinfoMapper extends BaseMapper<TBasicinfo> {

    /**
     * 获取列表
     *
     * @author zs
     * @Date 2021-04-23
     */
    List<TBasicinfoResult> customList(@Param("paramCondition") TBasicinfoParam paramCondition);

    /**
     * 获取map列表
     *
     * @author zs
     * @Date 2021-04-23
     */
    List<Map<String, Object>> customMapList(@Param("paramCondition") TBasicinfoParam paramCondition);

    /**
     * 获取分页实体列表
     *
     * @author zs
     * @Date 2021-04-23
     */
    Page<TBasicinfoResult> customPageList(@Param("page") Page page, @Param("paramCondition") TBasicinfoParam paramCondition);

    /**
     * 获取分页map列表
     *
     * @author zs
     * @Date 2021-04-23
     */
    Page<Map<String, Object>> customPageMapList(@Param("page") Page page, @Param("paramCondition") TBasicinfoParam paramCondition);


    List<TBasicinfo> getList(@Param("id")Integer id);

    @Select("select * from t_basicinfo where social_credit_code = #{sid} and del_flag != 2")
    TBasicinfo getDetailInfo(@Param("sid") String sid);

   @Select("select b.*,s.name as countyName  from t_basicinfo b left join sys_user s ON b.pid = s.user_id where b.id = #{id}")
    TBasicinfoResult getDetail(@Param("id") Integer id);



}
